package org.com.cron;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class Schedule {

	public final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Scheduled(cron = "0 0/1 * * * ?")
	public void timerToNow() {
		logger.debug("now time:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
	}

}
